package com.endava.spring.dao_interface;

import java.util.List;

import com.endava.spring.beans.Person;

/**
 * Interface used for Person operations.
 * 
 * @author acojocar
 * @since 30.07.2013
 * @version 1.0
 * 
 */
public interface PersonDao {

	/**
	 * Queries used for Data Base operations.
	 */
	public static final String INSERT_QUERY = "INSERT INTO person VALUES(?, ?, ?, ?);";
	public static final String SELECT_QUERY = "SELECT * FROM person;";
	public static final String DELETE_QUERY = "DELETE FROM person WHERE person_id = ?;";
	public static final String UPDATE_QUERY = "UPDATE person SET address = ? WHERE person_id = ?;";

	/**
	 * Reads the persons from Data Base and returns a list with them.
	 * 
	 * @return list of persons
	 */
	public List<Person> read();

	/**
	 * Creates a object <code>Person</code>, with it's attributes.
	 * 
	 * @param personID
	 *            the ID of person
	 * @param firstName
	 *            the first name
	 * @param lastName
	 *            the last name
	 * @param address
	 *            the address
	 */
	public void create(Integer personID, String firstName, String lastName,
			String address);

	/**
	 * Deletes an account from Data Base, by ID.
	 * 
	 * @param personID
	 *            the ID of person
	 */
	public void deleteAccount(Integer personID);

	/**
	 * Updates the address of <code>Person</code>.
	 * 
	 * @param personID
	 *            the person ID to make update
	 * @param address
	 *            the new address
	 */
	public void update(Integer personID, String address);

}
